<template>
  <component :is="componentName" :id="rowId" @subPage="subPage"></component>
</template>
<script setup lang="ts" name="noticeManage">
import NoticeTable from './noticeTable.vue'
import NoticeDetail from '@/views/components/noticeDetail/index.vue'

let rowId: undefined | number = undefined
const componentName: Record<string, any> = ref(NoticeTable)
const pageList = [NoticeTable, NoticeDetail]
const subPage = (index: number, id: number) => {
  componentName.value = pageList[index]
  if (index === 1) {
    rowId = id
  }
}
</script>
